<html>
<head>

	<meta name="page-view-size" content="1280*720"/>
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <link rel="stylesheet" href="neterror.css" type="text/css" media="all"/>

    <script type="text/javascript">

        var $G = {

            "getParameter": function (param) {
                var query = window.location.search; //获取URL"?"后面的字符串
                if (query.length == 0) {
                    return "";
                }
                else {
                    var iLen = param.length;
                    var iStart = query.indexOf(param);
                    if (iStart == -1) //判断是否有那个需要查询值的传递参数
                        return ""; //没有就返回一个空值
                    iStart += iLen + 1;
                    var iEnd = query.indexOf("&", iStart); //判断是不是带有多个参数   &为多个参数的连接符号
                    if (iEnd == -1) {
                        return query.substring(iStart);
                    }
                    return query.substring(iStart, iEnd);
                }
            },
            "validChecker": function (type, value) {
                var t = typeof(value);
                var retValue = null;
                if (1) {//无论哪种类型, 都要进行简单判断
                    switch (t) {
                        case "undefined":
                            return false;
                            break;
                        case "number":
                            if (value == 0) return false;
                            break;
                        case "boolean":
                            if (!value) return false;
                            break;
                        case "string":
                            if (value == "") return false;
                            break;
                        case "object":
                            if (value == null) return false;
                            if (typeof(value.length) != "undefined") {
                                if (value.length == 0) return false;
                            }
                            break;
                        case "function":
                            break;
                        default:
                            return false;
                    }
                }

                if (type == "") return true;

                else if (type == "stringnum") {
                    var val = parseInt(value);
                    if (typeof(val) == "number") return true;
                    return false;
                }
                else if (type == "ip") {
                    return false;
                }
            }
        }


        function errorString(errorCode) {
            var errStr = "";
            code = parseInt(errorCode, 10);
            switch (code) {
                case 1:
                    errStr = "不支持的协议";
                    break;
                case 2:
                    errStr = "网络初始化失败";
                    break;
                case 3:
                    errStr = "URL格式错误";
                    break;
                case 5:
                    errStr = "无法解析代理";
                    break;
                case 6:
                    errStr = "无法解析主机";
                    break;
                case 7:
                    errStr = "找不到服务器";
                    break;
                case 21:
                    errStr = "引用错误";
                    break;
                case 22:
                case 34:
                    errStr = "HTTP连接错误";
                    break;
                case 23:
                case 26:
                    errStr = "下载资源读写失败";
                    break;
                case 25:
                    errStr = "上传失败";
                    break;
                case 27:
                    errStr = "内存不足";
                    break;
                case 28:
                    errStr = "服务器连接超时";
                    break;
                default:
                    errStr = "连接失败";
                    break;
            }
            return errStr;
        }

        function showError() {
            var errCode = $G.getParameter("errorCode");
            var errStr = errorString(errCode);
            document.getElementById("errorShortDescText").innerHTML = errStr;
        }
        function retry() {
            var failingURL = $G.getParameter("failingURL");
            window.location.href = failingURL;
        }

        function back() {
            window.history.go(-1);
        }
        //window.onload = showError;
		
		function keyEventHandler(keyEvent) {
			keyEvent = keyEvent ? keyEvent : window.event;
			keyEvent.which = keyEvent.which ? keyEvent.which : keyEvent.keyCode;
			switch(keyEvent.which) {
			case 768:
				//vitualkeyEvent();
				break;

			case 8: //back
				back();
				break;

			default:
				return false;
				break;
			}
		}
		window.document.onkeypress = keyEventHandler;
    </script>
</head>



<body onLoad="showError();">


<div id="errorPageContainer">
	<div class="bg"></div>
    <div class="con">
        <div id="warningicon">
            <img src="warning.png">
        </div>

        <div id="errorTitle">
            <h1 id="errorTitleText">您指定的网页无法访问!</h1>
        </div>

		<div id="errorLongContent">

			<div id="errorShortDesc">
				<p>错误类型: <span id="errorShortDescText">连接失败</span></p>	
			</div>

			<div id="errorLongDesc">
				<ul>
					<li>此站点暂时不可用或者太忙。请稍后重试，或尝试按“首页”或“返回”键返回。</li>
					<li>如果您无法载入任何页面，请检查您机顶盒的网络连接。</li>
					<li>如果您的机顶盒受到防火墙或代理服务器的保护，请确认是否被授权访问网页。</li>
				</ul>
			</div>
		</div>
	</div>
</div>

</body>
</html>